﻿//using Microsoft.Extensions.DependencyInjection;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace Marmat.FrameWork.DependencyInjection
//{
//    /// <summary>
//    /// 用于向一个 Microsoft.Extensions.DependencyInjection. IServiceCollection 中添加服务的扩展方法。
//    /// </summary>
//    public static class ServiceCollectionServiceExtensions
//    {
//        /// <summary>
//        /// 添加一个在TService中指定类型的临时服务
//        /// 在对指定的Microsoft.Extensions.DependencyInjection.IServiceCollection的实现中指定的类型。
//        /// </summary>
//        /// <typeparam name="TService">要添加的服务类型。</typeparam>
//        /// <typeparam name="TImplementation">要使用的实现类型。</typeparam>
//        /// <param name="services">Microsoft.Extensions.DependencyInjection.IServiceCollection添加服务</param>
//        /// <returns>操作完成后对该实例的引用。</returns>
//        public static IServiceCollection AddTransient<TService, TImplementation>(this IServiceCollection services)
//            where TService : class
//            where TImplementation : class, TService
//        {
//            return Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddTransient<TService, TImplementation>(services);
//        }

//        /// <summary>
//        /// 添加一个在TService中指定类型的单例服务
//        /// 在对指定的Microsoft.Extensions.DependencyInjection.IServiceCollection的实现中指定的类型。
//        /// </summary>
//        /// <typeparam name="TService">要添加的服务类型。</typeparam>
//        /// <typeparam name="TImplementation">要使用的实现类型。</typeparam>
//        /// <param name="services">Microsoft.Extensions.DependencyInjection.IServiceCollection添加服务</param>
//        /// <returns>操作完成后对该实例的引用。</returns>
//        public static IServiceCollection AddSingleton<TService, TImplementation>(this IServiceCollection services)
//            where TService : class
//            where TImplementation : class, TService
//        {
//            return Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<TService, TImplementation>(services);
//        }

//        /// <summary>
//        /// 使用实现添加TService中指定的类型的限定范围的服务
//        /// 在对指定的Microsoft.Extensions.DependencyInjection.IServiceCollection的实现中指定的类型。
//        /// </summary>
//        /// <typeparam name="TService">要添加的服务类型。</typeparam>
//        /// <typeparam name="TImplementation">要使用的实现类型。</typeparam>
//        /// <param name="services">Microsoft.Extensions.DependencyInjection.IServiceCollection添加服务</param>
//        /// <returns>操作完成后对该实例的引用。</returns>
//        public static IServiceCollection AddScoped<TService, TImplementation>(this IServiceCollection services)
//            where TService : class
//            where TImplementation : class, TService
//        {
//            return Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddScoped<TService, TImplementation>(services);
//        }
//    }
//}
